做題筆記:Longest Common Prefix (Java)

還滿難的一道題。 題目描述: 編寫一個函數來查找字符串數組中最長的共有前綴字符串。 如果沒有共有前綴,則返回一個空字符串””。 Example 1: Example 2: Horizontal scanning: 自己嘗試的方法: 1 ms Vertical scanning: Solution 中提供的方法二: Divide and conquer: Solution 中提供的方法三: Binary search: Solution 中提供的方法四: